package com.study.mybatis;

import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanNameGenerator;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

import java.util.Map;

/**
 * @program: shouxieSpring
 * @author: jzhou
 * @date: 2022-05-11 22:20
 * @version: 1.0
 * @description:
 **/

public class ZhouyuImportBeanDefinitionRegistrar implements ImportBeanDefinitionRegistrar {
    @Override
    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry, BeanNameGenerator importBeanNameGenerator) {
        Map<String, Object> annotationAttributes = importingClassMetadata.getAnnotationAttributes(ZhouyuScan.class.getName());
        String path = (String) annotationAttributes.get("value");
        System.out.println(path);
    }
}
